<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>选课学生名单</title>
</head>
<body>
<%@include file="teaindex.jsp" %>
<div style="width: 70%;margin-left: 15%;">
<form class="form-inline" action="stubycoulist" style="margin-left: 15%;">
<div class="input-group mb-3">
  <div class="input-group-prepend">
    <label class="input-group-text" for="inputGroupSelect01">选择课程</label>
  </div>
  <select class="custom-select" name="cno" id="inputGroupSelect01">
    <c:forEach var="c" items="${courseByTid }" >
    <option value="${c.cno }">${c.cname }</option>
    </c:forEach>
  </select>
</div>
<button type="submit" class="btn btn-primary mb-2">查询</button>
</form>
<c:if test="${stubycoulist!=null }">
<table class="table table-dark"
		style="margin-left: 15%; margin-right: 15%; width: 70%;">
		<thead>
		<tr><th style="text-align: center;">${cname }选课学生名单</th></tr>
			<tr>
				<th scope="col">学号</th>
				<th scope="col">姓名</th>
				<th scope="col">性别</th>
				<th scope="col">专业</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="s" items="${stubycoulist }">
				<tr>
					<th scope="row">${s.sno }</th>
					<td>${s.sname }</td>
					<td>${s.ssex }</td>
					<td>${s.specialities }</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	</c:if>
</div>
</body>
</html>